package com.xiaoq.distribution.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xiaoq.distribution.entity.DistributorEntity;
import com.xiaoq.distribution.repository.IDistributorRepository;
import com.xiaoq.distribution.service.IDistributorService;
import com.xiaoq.vo.PagingVo;

@Service
public class DistributorServiceImpl implements IDistributorService {
	
	@Autowired
	private IDistributorRepository distributorRep;

	@Override
	public DistributorEntity addDistributor(DistributorEntity distributor) {
		return distributorRep.addDistributor(distributor);
	}

	@Override
	public DistributorEntity findById(String id) {
		return distributorRep.findById(id);
	}

	@Override
	public List<DistributorEntity> findByShopId(String shopId,PagingVo pvo) {
		return distributorRep.findByShopId(shopId,pvo);
	}

	@Override
	public List<DistributorEntity> findByShopId4Agreement(String shopId) {
		
		return distributorRep.findByShopId4Agreement(shopId);
	}

	@Override
	public DistributorEntity getDistributorByClientId(String clientId) {
		return distributorRep.getDistributorByClientId(clientId);
	}

	@Override
	public List<DistributorEntity> getListByShopIdAndAgree(String shopId, String isAgree) {
		return distributorRep.getListByShopIdAndAgree(shopId, isAgree);
	}

	@Override
	public DistributorEntity findByname(String name) {
		return distributorRep.findByname(name);
	}
}
